home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 24
/
AACD 24.iso
/
AACD
/
Information
/
WebSites
/
Eyetech
/
DOWNLOAD
/
PARNE030.LHA
/
parnet
/
test
/
machaddr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-06
|
819b
|
47 lines
/*
* MACHADDR.C
*
* MACHADDR addr
*
* this program sets the machine address for parnet.device
*/
#include "defs.h"
typedef struct IORequest IOR;
Iob iob;
int
brk(void)
{
return(0);
}
void
main(ac, av)
int ac;
char *av[];
{
PORT *port = CreatePort(NULL, 0);
onbreak(brk);
iob.io_Message.mn_ReplyPort = port;
iob.io_Port = 0;
iob.io_Flags= PRO_CONTROL;
if (OpenDevice("parnet.device", 0, (IOR *)&iob, 0)) {
printf("Unable to open parnet.device, error %d %d\n", iob.io_Error, iob.io_Actual);
exit(1);
}
printf("Device $%08lx Unit $%08lx\n", iob.io_Device, iob.io_Unit);
iob.io_Addr = atoi(av[1]);
iob.io_Command = PPD_SETADDR;
DoIO((IOR *)&iob);
printf("SetAddr, error code %d\n", iob.io_Error);
CloseDevice((IOR *)&iob);
DeletePort(port);
}